using System.Collections;
using System.Collections.Generic;
using OneDayModel.Interfaces;

namespace OneDayModel.Model
{
    public class Album : IAlbum, IEnumerable<string>
    {
        private readonly string albumName;
        private readonly List<string> pictures = new List<string>();

        public Album(string albumName)
        {
            this.albumName = albumName;
        }

        public string Name
        {
            get
            {
                return albumName;
            }
        }

        #region IAlbum Members

        public void AddPicture(string name)
        {
            if (!pictures.Contains(name))
                pictures.Add(name);
        }

        #endregion

        #region IEnumerable<string> Members

        IEnumerator<string> IEnumerable<string>.GetEnumerator()
        {
            return pictures.GetEnumerator();
        }

        #endregion

        #region IEnumerable Members

        public IEnumerator GetEnumerator()
        {
            return ((IEnumerable<string>) this).GetEnumerator();
        }

        #endregion
    }
}